package com.changgou.goods.dao;

import com.changgou.goods.pojo.Brand;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;


public interface BrandMapper extends Mapper<Brand> {
    //这里写一个根据分类名称查询列表,泛型是List<Map>,因为查询的结果是多个,而且每一个都是map类型的

    @Select("SELECT tb.name,tb.image FROM tb_brand tb, tb_category_brand tcb, tb_category tc WHERE tb.id = tcb.brand_id AND tcb.category_id=tc.id AND tc.name=#{name}")
    public List<Map>  findListByCategoryName(@Param("name") String categoryName);



}
